//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#include "../Case.h"

using namespace Native::System;

CCase::CCase()
{
}

CCase::CCase(C_CASE& that) :
    CObject(that),
    _scene(that._scene),
    _message(that._message),
    _arguments(that._arguments),
    _detail(that._detail)
{
}

CCase::CCase(C_CASE&& that) :
    CObject(that),
    _scene(that._scene),
    _message(that._message),
    _arguments(that._arguments),
    _detail(that._detail)
{
}

CCase::CCase(C_SCENE& scene, WSTRING& message, WSTRING& arguments, WSTRING& detail) :
    _scene(scene),
    _message(message),
    _arguments(arguments),
    _detail(detail)
{
}

wstring CCase::ToString() const
{
    wchar_t text[MAX_MESSAGE_LENGTH] = {0};
    wsprintf(
        text,
        L"Scene:{%s},Message:[%s],Detail:[%s],Arguments:[%s]",
        _scene.ToString().c_str(),
        _message.c_str(),
        _detail.c_str(),
        _arguments.c_str());

    return text;
}

bool CCase::operator==(C_CASE& rvalue) const
{
    return
        _scene == rvalue._scene &&
        _message == rvalue._message &&
        _arguments == rvalue._arguments &&
        _detail == rvalue._detail;
}

bool CCase::operator!=(C_CASE& rvalue) const
{
    return !operator==(rvalue);
}

C_CASE& CCase::operator=(C_CASE& rvalue)
{
    _scene = rvalue._scene;
    _message = rvalue._message;
    _arguments = rvalue._arguments;
    _detail = rvalue._detail;

    return *this;
}
